package main

import (
	"fmt"
	"strings"
)

// 返回最大重复值k

func maxRepeating(sequence string, word string) int {
	var res int = 1
	for {
		newS := strings.Repeat(word, res)
		fmt.Println(newS)
		if strings.Contains(sequence, newS) {
			res++
			continue
		} else {
			break
		}
	}
	return res - 1
}

func main() {
	sequence := "ababc"
	word := "ab"
	res := maxRepeating(sequence, word)
	fmt.Println(res)
}
